<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Fileupload extends Account_Controller
{
    function __construct()
    {
        parent::__construct();
        $this->load->model("images_m");
    }

    function index()
    {
        if ($this->input->server('REQUEST_METHOD') == "POST") {
            $this->load->library("Upload_Image");
            $result = $this->upload_image->post(true);
            $info = json_decode($result);
            $productId = $this->input->post('product_id');
            // $result is json check status = true insert database
            if($info->files[0]->status== true) {

            }
            log_message('error',$productId);
            $this->upload_image->body($result);
        }
    }

}